import type { Component } from 'vue'
import type { RouteRecordRaw } from 'vue-router'

function Layout(): Component {
  return import('@/layouts/index.vue')
}

const routes: RouteRecordRaw = {
  path: '/receiving',
  component: Layout,
  redirect: '/receiving/page', // 添加重定向
  name: 'receivingManagement',
  meta: {
    title: '收货管理',
    icon: 'i-ep:box',
    hidden: true,
  },
  children: [
    {
      path: 'receiveingPage',
      component: () => import('@/views/receiving/notAccept.vue'),
      name: 'receivingPage',
      meta: {
        title: '待到货',
        activeMenu: '/receiving/page',
      },
    },
    {
      path: 'unloadingPage',
      component: () => import('@/views/receiving/unload.vue'),
      name: 'unloadingPage',
      meta: {
        title: '待卸货',
        activeMenu: '/receiving/page',
      },
    },
    {
      path: 'unsortingPage',
      component: () => import('@/views/receiving/sort.vue'),
      name: 'unsortingPage',
      meta: {
        title: '待分拣',
        activeMenu: '/receiving/page',
      },
    },
    {
      path: 'putawayPage',
      component: () => import('@/views/receiving/shelf.vue'),
      name: 'putawayPage',
      meta: {
        title: '待上架',
        activeMenu: '/receiving/page',
      },
    },
  ],
}

export default routes
